<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.7/iconfont.css" rel="stylesheet" type="text/css" />
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />

<link href="css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script> 
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<style type="text/css">
.radio-box label{cursor: pointer;}
	label.col-2{width: 120px;}
</style>
<title>商家编辑</title>
</head>
<body>
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="form1">
		
		<input type="hidden" name="uid" id="uid">
		<div class="row cl">
			<label class="form-label col-2">申请人：</label>
			<div class="formControls col-1">
				<input type="text" class="input-text" value="" placeholder="" name="name"  disabled>
			</div>			
<!-- 			<div class="col-1"></div> -->
			<label class="form-label col-1">手机号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="mobile" disabled>
			</div>
			<label class="form-label col-1">微信号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="wx_name" disabled>
			</div>
<!-- 			<div class="col-1"></div> -->
		</div>
		<div class="row cl">
			<label class="form-label col-2">身份证号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="card"  disabled>
			</div>			
<!-- 			<div class="col-1"></div> -->
			<label class="form-label col-1">地址：</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" name="address" disabled>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-2">店铺照：</label>
			<div class="formControls col-8">
				<span class="l mb-10 fujian" id="card_img">
				</span>
			</div>
		</div>


		<div class="row cl">
			<label class="form-label col-2">代理品牌：</label>
			<div class="formControls col-1">
				<input type="text" class="input-text" value="" placeholder="" name="agent_brand"  disabled>
			</div>			
<!-- 			<div class="col-1"></div> -->
			<label class="form-label col-1">代理账号：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="agent_name" disabled>
			</div>
<!-- 			<div class="col-1"></div> -->
			<label class="form-label col-1">授权码：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="agent_sn" disabled>
			</div>
<!-- 			<div class="col-1"></div> -->
		</div>
		<div class="row cl">
			<label class="form-label col-2">线下店铺：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" name="store_name" disabled>

			</div>	
		</div>
		<div class="row cl">
			<label class="form-label col-2">店铺环境：</label>
			<div class="formControls col-8">
				<span class="l mb-10 fujian" id="store_img">
				</span>
			</div>
		</div>	
		
		<div class="row cl">
			<label class="form-label col-2">操作：</label>
			<div class="formControls col-8" id="control">
				<span class="btn btn-success radius" id="pass">通过</span>
				<span class="btn btn-warning radius" id="nopassedit">拒绝重新编辑</span>
				<span class="btn btn-secondary radius" id="close">关闭</span>
				<span class="btn btn-danger radius" id="refund">退款</span>

			</div>
        </div>
        <!-- 查看大图 -->
        <div class="cha_img hide" id="max_img_bg">
            <div class="pic-viewer-wrap">
                <div class="cha-img-nei">
                </div>
            </div>
            <div class="cha-img-close" onclick="$('#max_img_bg').addClass('hide')"><img src="./images/close.png"></div>
        </div>





		
		
		

		
</div>

<!-- <div class="row cl pr-20" style="position:fixed; bottom:10px; width: 200px; right: 10px; text-align: right; z-index:1000; ">
	
		<button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
		<button onClick="removeIframe();" class="btn btn-default radius" type="button" style="margin-left:10px;">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
	
</div>
 --></form>

<script type="text/javascript" src="lib/layer/2.1/layer.js"></script> 

<script type="text/javascript" src="lib/Validform/5.3.2/Validform.min.js"></script> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript" src="js/H-ui.js"></script> 
<script type="text/javascript" src="js/H-ui.admin.js"></script> 
<script type="text/javascript" src="js/template-native.js"></script> 
<script type="text/javascript" src="js/s.js"></script> 

<script type="text/javascript" src="lib/daterangepicker/moment.min.js"></script> 
<script type="text/javascript" src="lib/daterangepicker/jquery.daterangepicker.js"></script>
<link rel="stylesheet" href="lib/daterangepicker/daterangepicker.css" /> 


<script type="text/javascript">


var eidturl=API_SHOP;
var editid=getUrlParam('editid');
if(editid!==null){	     
	eidturl=API_SHOP+"?id="+editid;
}	
$("#form1").attr("action", eidturl); 



function removeIframe(){
	var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
}




$(function(){



    


	if(editid!==null){	     
	    $.getJSON(eidturl,function(data){
	    	console.log(data)

	    	if(!checkStatus(data)) return;//判断登录

	    	if(data.datas==''){
	    		layer.msg("数据加载错误", {icon:2,time:1000});
	    	}else{
	    		$("input[name=name]").val(data.datas.name);
	    		$("input[name=wx_name]").val(data.datas.wx_name);
	    		$("input[name=mobile]").val(data.datas.mobile);
	    		$("input[name=card]").val(data.datas.card);
	    		$("input[name=store_name]").val(data.datas.store_name);



	    		$("input[name=address]").val(data.datas.pro_name+data.datas.city_name+data.datas.address);
	    		$("input[name=agent_brand]").val(data.datas.agent_brand);
	    		$("input[name=agent_sn]").val(data.datas.agent_sn);
	    		$("input[name=agent_name]").val(data.datas.agent_name);

               
	    		if(data.datas.card_img[0]){
	    			for (x in data.datas.card_img){
			    	   	$('#card_img').append('<li><img class="pic-thumb" src="'+getIcon(data.datas.card_img[x])+'"></li>');	
			    	} 
	    		}else{
                    $('#card_img').append('<li><img src="./images/nodata.jpg"></li>');
                }
	    		if(data.datas.store_img[0]){
			    	for (x in data.datas.store_img){
			    	   	$('#store_img').append('<li><img class="pic-thumb" src="'+getIcon(data.datas.store_img[x])+'"></li>');	
			    	} 
			    }else{
                    $('#store_img').append('<li><img src="./images/nodata.jpg"></li>');
                }

		    	// if(data.datas.store_state==2 || data.datas.store_state==6){
		    	// 	$("#pass").show();
		    	// 	$("#nopassedit").hide();
		    	// 	$("#close").hide();
		    	// 	$("#refund").hide();
		    	// }
		    	// if(data.datas.store_state==2){
		    	// 	$("#nopassedit").show();

		    	// 	$("#pass").hide();
		    	// 	$("#close").hide();
		    	// 	$("#refund").hide();
		    	// }

		    	// if(data.datas.store_state==1 || data.datas.store_state==4){
		    	// 	$("#close").show();

		    	// 	$("#pass").hide();
		    	// 	$("#nopassedit").hide();
		    	// 	$("#refund").hide();
		    	// }
		    	// if(data.datas.store_state==6){
		    	// 	$("#refund").show();

		    	// 	$("#pass").hide();
		    	// 	$("#nopassedit").hide();
		    	// 	$("#close").hide();
		    	// }
		    	
		    	// 通过
		    	$(document).on('click','span#pass',function(){
		    		$.getJSON(API_SHOP_SHENHE,{
		    			store_id:editid,
		    			store_state:1,
		    		},function(data){
		    			if(!checkStatus(data)) return;
		    			console.log(data.info)
		    			window.parent.loaddata(parent.kk);
						layer.msg(data.info, {icon:1,time:1000});
   
		    		})
		    	})

		    	// 拒绝
		    	$(document).on('click','span#nopassedit',function(){
		    		layer.use('extend/layer.ext.js', function(){
						layer.prompt({
					        title:'拒绝理由',
					    },function(val, index){
					        layer.close(index);
							$.getJSON(API_SHOP_SHENHE,{
				    			store_id:editid,
				    			store_state:3,
				    			mark:val,
				    		},function(data){
				    			if(!checkStatus(data)) return;
				    			console.log(data)
				    			window.parent.loaddata(parent.kk);
				    			layer.msg(data.info,{icon:1,time:2000});
								// layer.msg(data.info, {icon:1,time:1000});
		   
				    		})
					    })
					})
		    	})

		    	// 拒绝并退款
		    	$(document).on('click','span#nopassrefund',function(){
		    		layer.use('extend/layer.ext.js', function(){
						layer.prompt({
					        title:'关闭理由',
					    },function(val, index){
					        layer.close(index);
							console.log(val)

					        $.getJSON(API_SHOP_REFOUND,{
					        	store_id:editid,
				        		mark:val,
					        },function(data){
					        	if(!checkStatus(data)) return;
					        	window.parent.loaddata(parent.kk);
					        	layer.msg(data.info, {icon:1,time:1000});
					        })
					    })
					})
		    	})

	    		// if(data.datas.image!==""){
			    //     $("#imgslt").html('<img src="'+data.datas.image+'">');
			    // }
	   



	    	}
	    })
	}
    $(document).on('click','.pic-thumb',function () {
        var path = $(this).attr('src');
        var html_img = "<img src='"+path+"'/>";
        $("#max_img_bg").find('.cha-img-nei').html(html_img);
        $("#max_img_bg").removeClass('hide');
    });

	



	Validformsubmit("#form1");
	
	

	

	



	










	

	
	



});


// 移除选中的图片
function fj_close(obj){
	$(obj).parents("li").remove();
}


</script>
</body>
</html>